// 自动生成模板ArchiveFile
package archive

import (
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"gorm.io/datatypes"
)

// 档案文件 结构体  ArchiveFile
type ArchiveFile struct {
	global.GVA_MODEL
	TypeId          *int            `json:"typeId" form:"typeId" gorm:"column:type_id;comment:档案类型;size:20;" binding:"required"`               //档案类型
	LocationId      *int            `json:"locationId" form:"locationId" gorm:"column:location_id;comment:线下存放位置;size:20;" binding:"required"` //线下存放位置
	Name            string          `json:"name" form:"name" gorm:"column:name;comment:档案名称;size:100;" binding:"required"`                     //档案名称
	File            datatypes.JSON  `json:"file" form:"file" gorm:"column:file;comment:档案文件;"`                                                 //档案文件
	ArchiveType     ArchiveType     `json:"archive-type" gorm:"foreignKey:TypeId;references:ID;comment:档案类型"`
	ArchiveLocation ArchiveLocation `json:"archive-location" gorm:"foreignKey:LocationId;references:ID;comment:档案存放位置"`
	CreatedBy       uint            `gorm:"column:created_by;comment:创建者"`
	UpdatedBy       uint            `gorm:"column:updated_by;comment:更新者"`
	DeletedBy       uint            `gorm:"column:deleted_by;comment:删除者"`
}

// TableName 档案文件 ArchiveFile自定义表名 archive_file
func (ArchiveFile) TableName() string {
	return "archive_file"
}
